![]() |
DisposeControl |
||||
Header: | Controls.h | Carbon status: | Supported | |
Removes a control and any of its embedded controls from a window that you wish to keep.
void DisposeControl ( ControlRef theControl );
A handle to the control you wish to remove.
The DisposeControl function removes the specified control (and any embedded controls it may possess) from the screen, deletes it from the window’s control list, and releases the memory occupied by the control structure and any data structures associated with the control.
To remove all of the controls from a window that you wish to keep, use the function KillControls. If an embedding hierarchy is present, passing the root control to the DisposeControl function is the effectively the same as calling KillControls. In that situation, DisposeControl disposes of the controls embedded within a control before disposing of the container control.
You should use DisposeControl when you wish to retain the window but remove one of its controls. The Window Manager functions CloseWindow and DisposeWindow automatically remove all controls associated with the window and release the memory the controls occupy.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)